* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
    padding: 20px;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    background: white;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
    padding: 30px;
}

h1 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 20px;
}

.team-members {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
    gap: 10px;
    flex-wrap: wrap;
}

.member {
    padding: 8px 15px;
    background: #e0e0e0;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s;
}

.member.active {
    background: #3498db;
    color: white;
    font-weight: bold;
}

.category-filters button {
    margin: 0 5px;
    padding: 6px 12px;
    border-radius: 15px;
    border: none;
    cursor: pointer;
    background: #e0e0e0;
    transition: all 0.3s;
}

.category-filters button.active {
    background: #3498db;
    color: white;
    font-weight: bold;
}

.add-item {
    display: flex;
    margin-bottom: 20px;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.add-item input[type="text"],
.add-item input[type="number"],
.add-item select {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
}

.add-item button {
    padding: 12px 20px;
    background: #2ecc71;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.3s;
}

.add-item button:hover {
    background: #27ae60;
}

.shopping-list {
    border: 1px solid #eee;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 30px;
}

.list-header {
    display: grid;
    grid-template-columns: 2.5fr 0.7fr 0.7fr 1fr 1fr 0.8fr 0.8fr;
    background: #3498db;
    color: white;
    padding: 12px 15px;
    font-weight: bold;
}

#itemsList {
    max-height: 400px;
    overflow-y: auto;
}

.item {
    display: grid;
    grid-template-columns: 2.5fr 0.7fr 0.7fr 1fr 1fr 0.8fr 0.8fr;
    padding: 12px 15px;
    border-bottom: 1px solid #eee;
    align-items: center;
}

.item:nth-child(even) {
    background: #f9f9f9;
}

.item.purchased .item-name {
    text-decoration: line-through;
    color: #95a5a6;
}

.item-name {
    font-weight: 500;
}

.member-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    text-align: center;
    color: white;
    display: inline-block;
    user-select: none;
}

.xiangyang {
    background: #e74c3c;
}

.changpeng {
    background: #3498db;
}

.jiangsiyu {
    background: #2ecc71;
}

.keyunhong {
    background: #9b59b6;
}

.yezhiwei {
    background: #e67e22;
}

.yanghaomin {
    background: #1abc9c;
}

.status {
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 14px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    user-select: none;
}

.status.pending {
    background: #f39c12;
    color: white;
}

.status.purchased {
    background: #2ecc71;
    color: white;
}

.delete-btn {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s;
    user-select: none;
}

.delete-btn:hover {
    background: #c0392b;
}

.instructions {
    background: #f8f9fa;
    border-left: 4px solid #3498db;
    padding: 15px;
    border-radius: 0 5px 5px 0;
}

.instructions h3 {
    margin-bottom: 10px;
    color: #2c3e50;
}

.instructions ol {
    padding-left: 20px;
}

.instructions li {
    margin-bottom: 8px;
}

.instructions code {
    background: #eef;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
}

@media (max-width: 600px) {
    .list-header,
    .item {
        grid-template-columns: 2fr 1fr 1fr 1fr 1fr 1fr 1fr;
    }

    .add-item {
        flex-direction: column;
        align-items: stretch;
    }
}
